{php include wl_template('common/header');}
<ul class="nav nav-tabs" id="myTab">
    <li class="active"><a href="#tab_basic">基础设置</a></li>
    <li ><a href="#tab_share">分享设置</a></li>
</ul>
<div class="app-content">
    <div class="app-form">
        <form action="" method="post" class="form-horizontal form form-validate">
            <div class="panel panel-default">
                <div class="panel-heading">话费充值设置</div>
                <div class="panel-body">
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab_basic">
                            <div class="alert alert-warning">
                                <p>请在三方充值平台系统后台查找对应数据填入设置项目</p>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">充值平台</label>
                                <div class="col-sm-9">
                                    <label class="radio-inline">
                                        <input type="radio" value="1" name="set[rechargePlatform]" onclick="divhs(1)" {if $settings['rechargePlatform']==1} checked {/if}>36鲸
                                    </label>
                                    <label class="radio-inline">
                                        <input type="radio" value="0" name="set[rechargePlatform]" onclick="divhs(0)" {if $settings['rechargePlatform']==0 || empty($settings) } checked {/if}>关闭
                                    </label>
                                </div>
                            </div>
                            <div class="sljdiv" {if $settings['rechargePlatform']!=1} style = "display: none;" {/if} >
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">36鲸账号</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="set[account]"   autocomplete="off" class="form-control" value="{$settings['account']}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">36鲸秘钥</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="set[secretkey]"   autocomplete="off" class="form-control" value="{$settings['secretkey']}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">36鲸接口域名</label>
                                    <div class="col-sm-9">
                                        <input type="text" name="set[domainname]"   autocomplete="off" class="form-control" value="{$settings['domainname']}">
                                        <span class="help-block">以http开头,'/'号结束。</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">慢充渠道</label>
                                    <div class="col-sm-9">
                                        <label class="radio-inline">
                                            <input type="radio" value="1" name="set[slowre]" onclick="$('#slowre').show();$('#slowdis').show();" {if $settings['slowre']==1} checked {/if}>开启
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" value="0" name="set[slowre]" onclick="$('#slowre').hide();$('#slowdis').hide();" {if $settings['slowre']==0 || empty($settings) } checked {/if}>关闭
                                        </label>
                                    </div>
                                </div>
                                <div id="slowre"   {if $settings['slowre']!=1} style = "display: none;" {/if}>
                                    <div class="form-group"  >
                                        <label class="col-sm-2 control-label">慢充金额设置</label>
                                        <div class="col-sm-9">
                                            <div class="input-group">
                                                <span class="input-group-addon">面值50元：价格￥</span>
                                                <input type="number" name="set[slowjing50price]" class="form-control" value="{$settings['slowjing50price']}" />
                                                <span class="input-group-addon">会员价￥</span>
                                                <input type="number" name="set[slowjing50vip]" class="form-control" value="{$settings['slowjing50vip']}" />
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon">面值100元：价格￥</span>
                                                <input type="number" name="set[slowjing100price]" class="form-control" value="{$settings['slowjing100price']}" />
                                                <span class="input-group-addon">会员价￥</span>
                                                <input type="number" name="set[slowjing100vip]" class="form-control" value="{$settings['slowjing100vip']}" />
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon">面值200元：价格￥</span>
                                                <input type="number" name="set[slowjing200price]" class="form-control" value="{$settings['slowjing200price']}" />
                                                <span class="input-group-addon">会员价￥</span>
                                                <input type="number" name="set[slowjing200vip]" class="form-control" value="{$settings['slowjing200vip']}" />
                                            </div>
                                            <span class="help-block">价格填0或不填则不开启此面值充值,会员价填0或者不填则没有会员价,价格均保留两位小数。</span>
                                        </div>
                                    </div>
                                    <div class="form-group"  >
                                        <label class="col-sm-2 control-label">慢充提示文本</label>
                                        <div class="col-sm-9">
                                            <div class="input-group" style="width: 100%;">
                                                <input type="text" name="set[slowtext]" class="form-control" value="{$settings['slowtext']}" />
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">快充渠道</label>
                                    <div class="col-sm-9">
                                        <label class="radio-inline">
                                            <input type="radio" value="1" name="set[fastre]" onclick="$('#fastre').show();$('#fastdis').show();" {if $settings['fastre']==1} checked {/if}>开启
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" value="0" name="set[fastre]" onclick="$('#fastre').hide();$('#fastdis').hide();" {if $settings['fastre']==0 || empty($settings) } checked {/if}>关闭
                                        </label>
                                    </div>
                                </div>
                                <div id="fastre"   {if $settings['fastre']!=1} style = "display: none;" {/if}>
                                    <div class="form-group"  >
                                        <label class="col-sm-2 control-label">快充金额设置</label>
                                        <div class="col-sm-9">
                                            <div class="input-group">
                                                <span class="input-group-addon">面值50元：价格￥</span>
                                                <input type="number" name="set[fastjing50price]" class="form-control" value="{$settings['fastjing50price']}" />
                                                <span class="input-group-addon">会员价￥</span>
                                                <input type="number" name="set[fastjing50vip]" class="form-control" value="{$settings['fastjing50vip']}" />
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon">面值100元：价格￥</span>
                                                <input type="number" name="set[fastjing100price]" class="form-control" value="{$settings['fastjing100price']}" />
                                                <span class="input-group-addon">会员价￥</span>
                                                <input type="number" name="set[fastjing100vip]" class="form-control" value="{$settings['fastjing100vip']}" />
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon">面值200元：价格￥</span>
                                                <input type="number" name="set[fastjing200price]" class="form-control" value="{$settings['fastjing200price']}" />
                                                <span class="input-group-addon">会员价￥</span>
                                                <input type="number" name="set[fastjing200vip]" class="form-control" value="{$settings['fastjing200vip']}" />
                                            </div>
                                            <span class="help-block">价格填0或不填则不开启此面值充值,会员价填0或者不填则没有会员价,价格均保留两位小数。</span>
                                        </div>
                                    </div>
                                    <div class="form-group"  >
                                        <label class="col-sm-2 control-label">快充提示文本</label>
                                        <div class="col-sm-9">
                                            <div class="input-group" style="width: 100%;">
                                                <input type="text" name="set[fasttext]" class="form-control" value="{$settings['fasttext']}" />
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">特快充渠道</label>
                                    <div class="col-sm-9">
                                        <label class="radio-inline">
                                            <input type="radio" value="1" name="set[mostre]" onclick="$('#mostre').show();$('#mostdis').show();" {if $settings['mostre']==1} checked {/if}>开启
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" value="0" name="set[mostre]" onclick="$('#mostre').hide();$('#mostdis').hide();" {if $settings['mostre']==0 || empty($settings) } checked {/if}>关闭
                                        </label>
                                    </div>
                                </div>
                                <div id="mostre"   {if $settings['mostre']!=1} style = "display: none;" {/if}>
                                <div class="form-group"  >
                                    <label class="col-sm-2 control-label">快充金额设置</label>
                                    <div class="col-sm-9">
                                        <div class="input-group">
                                            <span class="input-group-addon">面值50元：价格￥</span>
                                            <input type="number" name="set[mostjing50price]" class="form-control" value="{$settings['mostjing50price']}" />
                                            <span class="input-group-addon">会员价￥</span>
                                            <input type="number" name="set[mostjing50vip]" class="form-control" value="{$settings['mostjing50vip']}" />
                                        </div>
                                        <div class="input-group">
                                            <span class="input-group-addon">面值100元：价格￥</span>
                                            <input type="number" name="set[mostjing100price]" class="form-control" value="{$settings['mostjing100price']}" />
                                            <span class="input-group-addon">会员价￥</span>
                                            <input type="number" name="set[mostjing100vip]" class="form-control" value="{$settings['mostjing100vip']}" />
                                        </div>
                                        <div class="input-group">
                                            <span class="input-group-addon">面值200元：价格￥</span>
                                            <input type="number" name="set[mostjing200price]" class="form-control" value="{$settings['mostjing200price']}" />
                                            <span class="input-group-addon">会员价￥</span>
                                            <input type="number" name="set[mostjing200vip]" class="form-control" value="{$settings['mostjing200vip']}" />
                                        </div>
                                        <span class="help-block">价格填0或不填则不开启此面值充值,会员价填0或者不填则没有会员价,价格均保留两位小数。</span>
                                    </div>
                                </div>
                                <div class="form-group"  >
                                    <label class="col-sm-2 control-label">快充提示文本</label>
                                    <div class="col-sm-9">
                                        <div class="input-group" style="width: 100%;">
                                            <input type="text" name="set[mosttext]" class="form-control" value="{$settings['mosttext']}" />
                                        </div>
                                    </div>
                                </div>
                            </div>


                                {if uniacid_p('distribution')}
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">分销设置</label>
                                    <div class="col-sm-9">
                                        <label class="radio-inline">
                                            <input type="radio" value="1" name="set[rechargedis]" onclick="disdiv(1)" {if $settings['rechargedis']==1} checked {/if}>参与
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" value="0" name="set[rechargedis]" onclick="disdiv(0)" {if $settings['rechargedis']==0 || empty($settings) } checked {/if}>关闭
                                        </label>
                                    </div>
                                </div>
                                <div class="form-group disdiv"  {if $settings['rechargedis']!=1} style = "display: none;" {/if} >
                                    <div id="slowdis"  {if $settings['slowre']!=1} style = "display: none;" {/if}  >
                                        <label class="col-sm-2 control-label">慢充分销设置</label>
                                        <div class="col-sm-9">
                                            <div class="input-group">
                                                <span class="input-group-addon">面值50元：一级佣金：</span>
                                                <input type="number" name="set[slowjing50one]" class="form-control" value="{$settings['slowjing50one']}" />
                                                <span class="input-group-addon">二级佣金：</span>
                                                <input type="number" name="set[slowjing50two]" class="form-control" value="{$settings['slowjing50two']}" />
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon">面值100元：一级佣金：</span>
                                                <input type="number" name="set[slowjing100one]" class="form-control" value="{$settings['slowjing100one']}" />
                                                <span class="input-group-addon">二级佣金：</span>
                                                <input type="number" name="set[slowjing100two]" class="form-control" value="{$settings['slowjing100two']}" />
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon">面值200元：一级佣金：</span>
                                                <input type="number" name="set[slowjing200one]" class="form-control" value="{$settings['slowjing200one']}" />
                                                <span class="input-group-addon">二级佣金：</span>
                                                <input type="number" name="set[slowjing200two]" class="form-control" value="{$settings['slowjing200two']}" />
                                            </div>
                                            <span class="help-block">金额不填或填0会按照分销商等级佣金比例计算佣金,价格均保留两位小数。</span>
                                        </div>
                                    </div>

                                    <div id="fastdis"  {if $settings['fastre']!=1} style = "display: none;" {/if}  >
                                        <label class="col-sm-2 control-label">快充分销设置</label>
                                        <div class="col-sm-9">
                                            <div class="input-group">
                                                <span class="input-group-addon">面值50元：一级佣金：</span>
                                                <input type="number" name="set[fastjing50one]" class="form-control" value="{$settings['fastjing50one']}" />
                                                <span class="input-group-addon">二级佣金：</span>
                                                <input type="number" name="set[fastjing50two]" class="form-control" value="{$settings['fastjing50two']}" />
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon">面值100元：一级佣金：</span>
                                                <input type="number" name="set[fastjing100one]" class="form-control" value="{$settings['fastjing100one']}" />
                                                <span class="input-group-addon">二级佣金：</span>
                                                <input type="number" name="set[fastjing100two]" class="form-control" value="{$settings['fastjing100two']}" />
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon">面值200元：一级佣金：</span>
                                                <input type="number" name="set[fastjing200one]" class="form-control" value="{$settings['fastjing200one']}" />
                                                <span class="input-group-addon">二级佣金：</span>
                                                <input type="number" name="set[fastjing200two]" class="form-control" value="{$settings['fastjing200two']}" />
                                            </div>
                                            <span class="help-block">金额不填或填0会按照分销商等级佣金比例计算佣金,价格均保留两位小数。</span>
                                        </div>
                                    </div>
                                    <div id="mostdis"  {if $settings['mostre']!=1} style = "display: none;" {/if}  >
                                        <label class="col-sm-2 control-label">特快充分销设置</label>
                                        <div class="col-sm-9">
                                            <div class="input-group">
                                                <span class="input-group-addon">面值50元：一级佣金：</span>
                                                <input type="number" name="set[mostjing50one]" class="form-control" value="{$settings['mostjing50one']}" />
                                                <span class="input-group-addon">二级佣金：</span>
                                                <input type="number" name="set[mostjing50two]" class="form-control" value="{$settings['mostjing50two']}" />
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon">面值100元：一级佣金：</span>
                                                <input type="number" name="set[mostjing100one]" class="form-control" value="{$settings['mostjing100one']}" />
                                                <span class="input-group-addon">二级佣金：</span>
                                                <input type="number" name="set[mostjing100two]" class="form-control" value="{$settings['mostjing100two']}" />
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon">面值200元：一级佣金：</span>
                                                <input type="number" name="set[mostjing200one]" class="form-control" value="{$settings['mostjing200one']}" />
                                                <span class="input-group-addon">二级佣金：</span>
                                                <input type="number" name="set[mostjing200two]" class="form-control" value="{$settings['mostjing200two']}" />
                                            </div>
                                            <span class="help-block">金额不填或填0会按照分销商等级佣金比例计算佣金,价格均保留两位小数。</span>
                                        </div>
                                    </div>

                                </div>
                            {/if}
                        </div>
                        </div>
                        <div class="tab-pane" id="tab_share">
                            <div class="panel panel-default">
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">分享二维码类型</label>
                                        <div class="col-sm-9">
                                            <label class="radio-inline">
                                                <input type="radio" value="1" name="set[qrcodetype]" {if $settings['qrcodetype']==1} checked {/if}>关注二维码
                                            </label>
                                            <label class="radio-inline">
                                                <input type="radio" value="0" name="set[qrcodetype]" {if $settings['qrcodetype']==0} checked {/if}>普通二维码
                                            </label>
                                        </div>
                                    </div>
                                    <div class="alert alert-info">
                                        <b>适用模板变量：[昵称] [时间] [系统名称] </b>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">公众号分享图片</label>
                                        <div class="col-sm-9">
                                            {php echo attachment_select('set[share_image]', $settings['share_image']);}
                                            <span class="help-block">大小2M以下，建议尺寸500*500，如果不选择，默认为系统分享信息</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">小程序分享图片</label>
                                        <div class="col-sm-9">
                                            {php echo attachment_select('set[share_wxapp_image]', $settings['share_wxapp_image']);}
                                            <span class="help-block">大小2M以下，建议尺寸500*400，如果不选择，默认为系统分享信息</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">分享标题</label>
                                        <div class="col-sm-9">
                                            <input type="text" name="set[share_title]" class="form-control" value="{$settings['share_title']}" />
                                            <span class="help-block">如果不填写，默认为系统分享信息</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">分享描述</label>
                                        <div class="col-sm-9">
                                            <input type="text" name="set[share_desc]" class="form-control" value="{$settings['share_desc']}" />
                                            <span class="help-block">如果不填写，默认为系统分享信息</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"></label>
                    <div class="col-sm-9">
                        <input type="submit" name="submit" value="提交" class="btn btn-primary min-width" />
                        <input type="hidden" name="token" value="{$_W['token']}" />
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    function divhs(flag){
        if(flag == 1){
            $('.sljdiv').show();
        }else if(flag == 0){
            $('.sljdiv').hide();
        }
    }

    function disdiv(flag){
        if(flag == 1){
            $('.disdiv').show();
        }else if(flag == 0){
            $('.disdiv').hide();
        }
    }

    $(function() {
        window.optionchanged = false;
        $('#myTab a').click(function(e) {
            e.preventDefault(); //阻止a链接的跳转行为
            $(this).tab('show'); //显示当前选中的链接及关联的content
        })
    });

</script>
{php include wl_template('common/footer');}